In a related art, a method is proposed in which an azimuth is detected while taking into account an error caused by an inclination angle (a posture angle with respect to the horizon plane) of a compass if the compass is set at an angle relative to the horizon plane (refer to, for example, Patent Document 1).
In a method described in Patent Document 1, a magnetic sensor 100, a hall element 24, and an inclination sensor 22 are integrated into one. The magnetic sensor 100 detects two axis components of a magnetic vector defined in a plane parallel to a substrate. The hall element 24 detects a component of the magnetic vector in a direction perpendicular to the substrate. The inclination sensor 22 detects an inclination angle of the substrate. A proper azimuth is detected by correcting the two axis components detected by the magnetic sensor 100 and the vertical component detected by the hall element 24 on the basis of the inclination angles (a roll angle and a pitch angle) of the substrate detected by the inclination sensor 22.
[Patent Document 1] Japanese Unexamined Patent Application Publication No. 2002-196055